﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.ExecutionContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.ExecutionContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.ExecutionContext
{
    /// <summary>
    /// 工单实际参数仓储实现
    /// </summary>
    public class WorkOrderActualParameterRepository : EFEntityRepositoryProvider<WorkOrderActualParameter>, IWorkOrderActualParameterRepository
    {
        #region # 获取工单实际参数列表 —— ICollection<WorkOrderActualParameter> Find(Guid workOrderId)
        /// <summary>
        /// 获取工单实际参数列表
        /// </summary>
        /// <param name="workOrderId">工单Id</param>
        /// <returns>工单实际参数列表</returns>
        public ICollection<WorkOrderActualParameter> Find(Guid workOrderId)
        {
            IQueryable<WorkOrderActualParameter> actualParameters = base.Find(x => x.WorkOrder.Id == workOrderId);

            return actualParameters.ToList();
        }
        #endregion
    }
}
